package com.web.mapper;

import com.web.entity.User;
import com.web.util.RowMapper;

import java.sql.ResultSet;

public class UserMapper implements RowMapper {
    public Object mapRow(ResultSet rs) throws Exception {
        User user = new User();
        user.setId(rs.getInt("id"));
        user.setUsername(rs.getString("username"));
        user.setPassword(rs.getString("password"));
        user.setAge(rs.getInt("age"));
        user.setPhone(rs.getString("phone"));
        user.setSex(rs.getString("sex"));
        user.setAddress(rs.getString("address"));
        return user;
    }
}
